package com.cc.data_explore.logic.utils;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author cc
 * @version 1.0
 * @since 2025/3/30
 */
@Data
public class TreeNode<T> implements Serializable {

    @Serial
    private static final long serialVersionUID = 8951671745641167950L;

    @TableId(type = IdType.NONE)
    private Long id;
    @TableField("pid")
    private Long pid;
    /**
     * 子节点列表
     */
    @TableField(exist = false)
    private List<T> children = new ArrayList<>();
}